package com.tinckay.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.tinckay.common.constant.ProjectConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 仓体浇筑计划
 * </p>
 *
 * @author Jean
 * @since 2018-11-06
 */
@Data
@TableName("pour_storehouse_plan")
@ApiModel(value = "StorehousePlan对象", description = "仓体浇筑计划")
public class StorehousePlan extends Model<StorehousePlan> {

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "所属仓体编号")
    private String storeCode;

    @ApiModelProperty(value = "所属泵车编号")
    private String pumpCode;

    @ApiModelProperty(value = "浇筑序号")
    private Integer pourNo;

    /**
     * 100新增，
     * 90（监测准备完毕），
     * 99（监测准备中），
     * 10（速度15泵送），
     * 11（速度15泵送暂停），
     * 30（速度30泵送），
     * 31（速度30泵送暂停），
     * 0停止（完成浇筑）
     **/
    @ApiModelProperty(value = "浇筑仓体状态")
    private Integer storeState;

    @ApiModelProperty(value = "排入时间")
    private LocalDateTime inputTime;

    @ApiModelProperty(value = "A点标高")
    private Double firstA;

    @ApiModelProperty(value = "B点标高")
    private Double firstB;

    private Double firstAvg;

    @NotNull(message = "限速高度不能为空", groups = ProjectConstant.Save.class)
    @ApiModelProperty(value = "限速高度")
    private Double limitHeight;

    @ApiModelProperty(value = "停止高度")
    @NotNull(message = "停止高度不能为空", groups = ProjectConstant.Save.class)
    private Double stopHeight;

    @ApiModelProperty(value = "初始化时间")
    private LocalDateTime initTime;

    @ApiModelProperty(value = "速度A启动时间")
    private LocalDateTime startATime;

    @ApiModelProperty(value = "速度A启动时高度")
    private Double startAHeight;

    @ApiModelProperty(value = "速度A结束时间")
    private LocalDateTime endATime;

    @ApiModelProperty(value = "速度A浇筑时间 浇筑速度30m³/h")
    private Integer pourADuration;

    @ApiModelProperty(value = "速度A间隔时间")
    private Integer intervalADuration;

    @ApiModelProperty(value = "速度A浇筑方量")
    private Double pourACubic;

    @ApiModelProperty(value = "速度B启动时间")
    private LocalDateTime startBTime;

    @ApiModelProperty(value = "速度B启动时高度")
    private Double startBHeight;

    @ApiModelProperty(value = "速度B结束时间")
    private LocalDateTime endBTime;

    @ApiModelProperty(value = "速度B浇筑时间 浇筑速度15m³/h")
    private Integer pourBDuration;

    @ApiModelProperty(value = "速度B间隔时间")
    private Integer intervalBDuration;

    @ApiModelProperty(value = "速度B浇筑方量")
    private Double pourBCubic;

    @ApiModelProperty(value = "浇筑结束时高度")
    private Double endHeight;

    @NotNull(message = "计划浇筑日期不能为空")
    @ApiModelProperty(value = "计划浇筑日期")
    private LocalDate planTime;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建人")
    private String creator;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    /**
     * 运输任务
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "运输任务", hidden = false)
    private List<Task> transportTask;

    /**
     * 总耗时
     */
    @TableField(exist = false)
    private int consumeTime;

    /**
     * 浇筑耗时
     */
    @TableField(exist = false)
    private int castingTime;

    /**
     * 等待时间
     */
    @TableField(exist = false)
    private int waitTime;

    @TableField(exist = false)
    private Storehouse storehouse;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}
